package cn.itcast.service;

import cn.itcast.domain.delivery.Promotion;
import cn.itcast.domain.page.PageBean;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import java.util.Date;

public interface PromotionService {
    void save(Promotion promotion);
    //分页查询
    Page<Promotion> findPageData(Pageable pageable);
    @Path("/pagequery/{page}/{rows}")
    @GET
    @Produces({"application/xml","application/json"})
    PageBean<Promotion>findPageData(@PathParam("page") Integer page,@PathParam("rows") Integer rows);
    //http://localhost:8080/bos/services/promotionService/promotion/" + model.getId()
    //根据id查询
    @Path("/promotion/{id}")
    @GET
    @Produces({"application/xml","application/json"})
    Promotion getDetails(@PathParam("id") Integer id);
    //定时任务 定期更新活动状态
    void updataStatus(Date now);
}
